﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace Point2d
{
    class XmlUtil
    {
        XmlDocument _htmlDocument = new XmlDocument();
        public void LoadXml(string content)
        {
            _htmlDocument.LoadXml(content);
        }

        public XmlNode GetRoot()
        {
            return _htmlDocument.DocumentElement;
        }

        public void GetChildNodesByName(XmlNode node, string name, List<XmlNode> childNodes)
        {
            for (int i = 0; i < node.ChildNodes.Count; i++)
            {
                XmlNode childNode = node.ChildNodes[i];
                if (childNode.Name == name)
                {
                    childNodes.Add(childNode);
                }
            }
        }
    }
}
